import { Api } from './../../../../providers/api-service';
import { NoticeService } from './../../../../providers/notice-service';
import { NavController } from 'ionic-angular/navigation/nav-controller';
import { Component } from '@angular/core';
import { UrlService } from '../../../../providers/url-service';

@Component({
  selector: 'page-wallet-yaoqingmx',
  templateUrl: 'wallet-yaoqingmx.html',
})
export class WalletYaoQingMxPage {
  zyeList;
  Currency;

  constructor(
    public navCtrl: NavController,
    public url: UrlService,
    public notSer: NoticeService,
    public api: Api
  ) {
    this.zyeList = [];
    this.Currency = 0;
    this.init();

  }

  init() {
    this.GetUserCurrencyList(1);
    this.getUserInfo();
  }

  GetUserCurrencyList(pageIndex) {
    this.url.GetUserCurrencyList(pageIndex)
      .then(msg => {
        //console.log("邀请明细");
        //console.log(msg);
        this.zyeList = msg.Data.Items;
      })
      .catch(error => {
        this.notSer.showNoticeByToast(1, error.Msg);
      })
  }
  /**
   * 获取用户信息
   */
  getUserInfo() {

    this.url.getUser(this.api.getUserinfo("UserID"))
      .then(msg => {
        //console.log(msg);
        this.Currency = msg.Data.Currency;
      })
      .catch(error => {

      })
  }
  /**
   * 转余额
   */
  ZhuanYuE(){
    //console.log("转余额");
    




  }

}